package HP.p0904;

import p16.p1617.Inter;

import javax.swing.text.html.HTMLDocument;
import java.util.*;

public class MapDemo {
    public static void main(String[] args) {
        Map<Integer, String> map = new HashMap();
        map.put(1, "zhangsan");
        map.put(2, "lisi");

        System.out.println(map.containsKey(3));
        System.out.println(map.containsValue("lisi"));
        System.out.println(map.remove(1));
        Set<Integer> set = map.keySet();
        for (Integer i : set
                ) {
            System.out.println(i + "----" + map.get(i));

        }
        System.out.println("----------------");

/*
        Iterator<Integer> it = set.iterator();
        while (it.hasNext()) {
            //System.out.println(it.next()+"-----");
            //Collection list = map.values();
            //System.out.println(map.values());
            //System.out.println(list);
            Integer i = it.next();
            System.out.println(i + "----" + map.get(i));
        }
        System.out.println("------------");*/

    }
}
